package com.ssm.zhihu_ssm.dao;

import com.ssm.zhihu_ssm.entity.Classify;
import com.ssm.zhihu_ssm.entity.Question;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface QuestionDao {
    int insertQuestion(Question question);//插入问题
    void insertQuestionClassify(int question_id,int cid);
    void followQuestion(int uid, int question_id);//关注问题
    void deleteFollowQuestion(int uid, int question_id);//取关问题
    List<Question> getQuestionByUserId(int id);//根据用户id得到所有问题
    List<Question> getQuestionByClassifyId(int classify_id);//根据主题id查找问题及排名
    List<Question> getQuestionByAllClassify();//得到所有问题级排名
    Question getQuestionByQuestionId(int question_id, int uid);//根据问题id得到问题信息
    Map<String,Object> getClassifyNameByQuestionId(int question_id);//根据问题id得到话题
    List<Classify> getClassify();//得到话题
    void addQuestionSkimNum(int question_id);//问题阅读量加1
}
